﻿using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using System;
using System.Collections.Generic;

namespace ProxySourceGenerator
{
    /// <summary>
    /// MySyntaxReceiver
    /// </summary>
    internal class MySyntaxReceiver : ISyntaxReceiver
    {
        /// <summary>
        /// 所需要的节点
        /// </summary>
        internal List<SyntaxNode> SyntaxNodeList { get; } = new List<SyntaxNode>();

        /// <summary>
        /// <inheritdoc/>
        /// </summary>
        /// <exception cref="NotImplementedException"></exception>
        public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
        {
            if (syntaxNode.IsKind(SyntaxKind.ClassDeclaration) || syntaxNode.IsKind(SyntaxKind.InterfaceDeclaration))
                SyntaxNodeList.Add(syntaxNode);
        }
    }
}
